home *** CD-ROM | disk | FTP | other *** search
/ WINMX Assorted Textfiles / Ebooks.tar / Text - Tech - OS - Unix - ZeeBee Australia Inc. - Useful UNIX Hacking Commands (TXT).zip / ZeeBee Australia Inc. - Useful UNIX Hacking Commands.txt
Text File  |  2003-02-17  |  7KB  |  185 lines

  1.              ***  My  Favourite  UNIX  Commands  ***
  2.           *** A List Of Some OF The Most Useful UNIX 
  3.      *** Hacking Commands, and Some Hints On Their Usage ***
  4.          ***  Written By ZeeBee Australia Inc. 1990 ***
  5.  
  6.  
  7.  
  8.      Ok UNIX freaks, here is a little list of helpful UNIX commands and procedures which can be 
  9. of much assistance in gaining the fullest potential from any UNIX system.
  10.  
  11.  
  12. --------------------------------------------------------------------------------
  13.  
  14.  
  15.      It is fun and often usefull to create a file that is owned by someone else. On most systems 
  16. with slack security ie 99% of all UNIX systems, this is quite easily done. The chown command will 
  17. change any of your files to make someone else the owner. Format is as follows:
  18.  
  19. chown ownername filelist 
  20.  
  21.  
  22.      Where ownername is the new owner, and filelist is the list of files to change. You must own 
  23. the file which your are goin to change, unless you are a superuser....then u can change ANYTHING!
  24.  
  25.      chgrp is a similar command which will change the group ownership on a file. If you are going 
  26. to do both a chown and a chgrp on a file, then make sure you do the chgrp first! Once the file is 
  27. owned by someone else, you cant change nything about it!
  28.  
  29.  
  30. --------------------------------------------------------------------------------
  31.  
  32.  
  33.      Sometimes just seeing who is on the system is a challenge in itself. The best way is to 
  34. write your own version of who in C, but if you can't do that then this may be of some help to 
  35. you: 
  36.  
  37.  
  38.      who followed by on or more of the following flags:
  39.  
  40. -b Displays time sys as last booted.
  41. -H Precedes output with header.
  42. -l Lists lines waiting for users to logon. -q displays number of users logged on.
  43. -t displays time sys clock was last changed. -T displays the state field (a + indicates it is
  44.  
  45. possible to send to terminal, a - means u cannot)
  46.  
  47.  
  48. -u Give a complete listing of those logged on. 
  49.  
  50.  
  51.      **who -HTu is about the best choice for the average user**
  52.  
  53. ##by the way, the list of users logged on is kept in the file /etc/utmp. If you want to write 
  54. your own personalised version of who in C, you now know where to look!###
  55.  
  56.  
  57. --------------------------------------------------------------------------------
  58.  
  59.  
  60.      When a users state field (see -T flag option for who command) says that a user has their 
  61. message function on, this actually means that it is possible to get stuff onto their screen.
  62.  
  63.      Basically, every terminal on the system has a file corresponding to it. These files can be 
  64. found in the /dev directory. You can to anything to these files, so long as you have access -eg 
  65. you can read them, and write to them, but you will notice that they never change in size. They 
  66. are called character specific files, and are really the link between the system and the 
  67. terminals. Whatever you put in these files will go staright to the terminal it corresponds to.
  68.  
  69.      Unfortunately, on most systems, when the user logs in, the "mesg n" command is issued which 
  70. turns off write access to that terminal, BUT- if you can start cating to that terminal before 
  71. system issues the mesg n command, then you will continue to be able to get stuff up on that 
  72. terminal! This has many varied uses. 
  73.  
  74.      Check out the terminal, or terminal software being used. Often you will be able to remotely 
  75. program another users terminal, simply by 'cating' a string to a users screen. You might be able 
  76. to set up a buffer, capturing all that is typed, or you may be able to send the terminal into a 
  77. frenzy- (sometimes a user will walk away without realizing that they are sill effectively logged 
  78. on, leaving you with access to their account!). Some terminal types also have this great command 
  79. called transmit screen. It transmits everything on the screen, just as if the user had typed it!
  80.  
  81.      So just say I wanted to log off a user, then I would send a clear screen command (usually 
  82. ctrl l), followed by "exit" followed by a carriage return, followed by the transmit screen code. 
  83. Using ths technique you can wipe peoples directories or anything. My favourite is to set open 
  84. access on all their files and directories so I can peruse them for deletion etc at my own 
  85. leisure).
  86.  
  87.  
  88. --------------------------------------------------------------------------------
  89.  
  90.  
  91.      If you ever briefly get access to another persons account eg. they leave the room to go to 
  92. toilet or whatever, then simply type the following:
  93.  
  94. chmod 777 $HOME
  95. chmod 777 $MAIL 
  96.  
  97.  
  98.      Then clear the screen so they dont see what you just typed. 
  99.  
  100.      Now you can go look at their directory, and their mail, and you can even put mail in their 
  101. mail file. (just use the same format as any mail that is already there!). Next time they log in 
  102. the system will automatically inform them they have new mail!
  103.  
  104.  
  105. --------------------------------------------------------------------------------
  106.  
  107.  
  108.      Another way to send fake mail to people is to use the mail server. This method produces mail 
  109. that is slightly different to normal, so anyone who uses UNIX a bit may be suspiscious when they 
  110. receive it, but it will fool the average dumb fuck user!
  111.  
  112. type telnet
  113.  
  114.  
  115. the following prompt will appear:
  116.  
  117. telnet>
  118.  
  119. now type :
  120.  
  121. open localhost 25
  122.  
  123.  
  124. some crap will come up about the mail server..now type:
  125.  
  126. mail from: xxxxxx Put any name you want.
  127.  
  128.  
  129. some more bullshit will come up. Now type:
  130.  
  131. rcpt to: xxxxxx Put the name of the person to receive mail here.
  132.  
  133.  
  134. now type:
  135.  
  136. data
  137.  
  138. now you can type the letter...end it with a "."
  139.  
  140. type quit to exit once you are done.
  141.  
  142.  
  143. --------------------------------------------------------------------------------
  144.  
  145.  
  146.      Heres one for any experimenters out there... It is possible to create files which simply 
  147. cannot be deleted from the standard shell. To do this you will have to physically CREATE THE FILE 
  148. USING A C PROGRAM or SCRIPT FILE, and you will have to use a sequence of control characters which 
  149. cannot be typed from the shell. Try things like Ctrl-h (this is the code for the delete key). 
  150. Just a file with the name Ctrl-h would not be deleteable from the shell, unless you used 
  151. wildcards. So, make it a nice long series of characters, so that to delete the file, the user has 
  152. no choice but to individually copy all his files elsewhere, then delete everything in his 
  153. directory, and then copy all his files back.....this is one of my favourites..gets em every time! 
  154.  
  155.      The following script file is an example which will create a file with the name Ctrl-h. You 
  156. MUST tyoe this file in using the vi editor or similar.
  157.  
  158. *****If you are not very good with vi, type "man vi" and print the help file...it even contains 
  159. stuff that I find useful now and then.*****
  160.  
  161. type the following in vi...
  162.  
  163. echo'' > 'a^h' 
  164.  
  165.  
  166.      ***NOTE...to get the ^h (this really means ctrl-h) from vi type:
  167.  
  168. Ctrl v
  169. Ctrl h 
  170.  
  171.  
  172.      The Ctrl v instrcts vi to take the next character as a ascii character, and not to interpret 
  173. it.
  174.  
  175.      change the access on the file you just created and now execute it. It will create a file 
  176. which looks like it is called a, but try to delete it !..use wildcards if you really want to 
  177. delete it.
  178.  
  179.  
  180. --------------------------------------------------------------------------------
  181.  
  182. Watch for more in the ZeeBee UNIX (ab)usage series.
  183.  
  184. Downloaded From P-80 Systems 304-744-2253
  185.